import { Router, Route, Switch } from "react-router-dom"
import AuteRoute from "components/AuthRoute"
import history from "utils/history"
import Login from "pages/Login"
import Home from "pages/Layout"
function App() {
  return (
    <Router history={history}>
      <div className='App'>
        {/* 配置路由规则 */}
        <Switch>
          <AuteRoute path='/home' component={Home}></AuteRoute>
          {/* <Route
            path='/home'
            render={(props) => {
              if (hasToken()) {
                return <Home {...props} />
              } else {
                return <Redirect to='/login' />
              }
            }}
          ></Route> */}
          <Route path='/login' component={Login}></Route>
        </Switch>
      </div>
    </Router>
  )
}

export default App
